#!/system/bin/sh

FILES="
/data/data/com.teslacoilsw.quicksshd/home/
/system/app/AlarmLauncher.apk
/system/app/BarcodeScanner.apk
/system/app/ChromeToPhone.apk
/system/app/ConnectBot.apk
/system/app/FlashLight.apk
/system/app/FlashPlayer.apk
/system/app/Gmail.apk
/system/app/Listen.apk
/system/app/Maps.apk
/system/app/Motonav.apk
/system/app/Operadora.apk
/system/app/QuickOffice.apk
/system/app/QuickSSHd.apk
/system/app/Reader.apk
/system/app/RealCalc.apk
/system/app/RockPlayer.apk
/system/app/RootExplorer.apk
/system/app/ScreenshotIt.apk
/system/app/SetCPU.apk
/system/app/Street.apk
/system/app/Superuser.apk
/system/app/Swype.apk
/system/app/VoiceSearch.apk
/system/app/Watchdog.apk
/system/app/YouTube.apk
/system/app/Zeam.apk
/system/etc/init.d/71_overclock
/system/xbin/backup
/system/xbin/bash
/system/xbin/remountsys
/system/xbin/sqlite3
/system/xbin/unyaffs
/system/xbin/zipalign
"

case "${#}" in

	0)
		TARGET="/sdcard/backup/$(date '+%Y%m%d_%H%M').tar"
		tar cvf "${TARGET}" ${FILES}
		;;

	1)
		TARGET="${1}"

		if [ -e "${TARGET}" ]; then
			echo "${TARGET} already exists."
			exit 1
		else
			tar cvf "${TARGET}" ${FILES}
		fi
		;;

	*)
		echo "Usage: $(basename ${0}) {filename.tar}"
		exit 1
		;;
esac
